package com.FSS.util;

import java.io.IOException;

import com.FSS.File.IFile;
import com.FSS.config.Config;

public class OpenThread extends Thread {
	IFile openFile;
	public OpenThread(IFile file){
		openFile = file;
	}
	@Override
	public void run() {
		String cmd="";
		Runtime r = Runtime.getRuntime();
		if(openFile.getForm().equals(".doc"))
			cmd+=Config.WORD_LOCATION;
		else if(openFile.getForm().equals(".xls"))
			cmd+=Config.EXCEL_LOCATION;
		try {
			r.exec(cmd+" "+Config.DOC_LOCATION+openFile.getName());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
